Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query_builder): add orderByRandom #1011

Open
wants to merge 4 commits into
base: 21.x
Choose a base branch
from
Open

Conversation

RomainLanz
Copy link
Member

Hey there! 👋🏻

This PR adds a orderByRandom method to retrieve records in a random order.
It defines the right keyword for each dialect.

The test may be flaky, I have set it up to run 3 times in case it fails.

A seed can be pass when using MySQL (same as Laravel implementation).

@RomainLanz
Copy link
Member Author

I am not sure how to deal with the mssql error. We are not passing multiple NEWID() to the order by clause. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants